package com.lzxzjy.pojo;

public class Admin {
    private Integer adminId;           // 管理员编号
    private String adminName;          // 管理员名称
    private String adminPhone;         // 联系电话
    private String adminPassword;      // 密码
    private Integer adminState;        // 管理员账号状态
    private String adminEmail;         // 管理员邮箱


    // 构造函数
    public Admin() {
    }

    public Admin(Integer adminId, String adminName, String adminPhone, String adminPassword, Integer adminState, String adminEmail) {
        this.adminId = adminId;
        this.adminName = adminName;
        this.adminPhone = adminPhone;
        this.adminPassword = adminPassword;
        this.adminState = adminState;
        this.adminEmail = adminEmail;
    }

    // get 和 set 方法
    public Integer getAdminId() {
        return adminId;
    }

    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }

    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    public String getAdminPhone() {
        return adminPhone;
    }

    public void setAdminPhone(String adminPhone) {
        this.adminPhone = adminPhone;
    }

    public String getAdminPassword() {
        return adminPassword;
    }

    public void setAdminPassword(String adminPassword) {
        this.adminPassword = adminPassword;
    }

    public Integer getAdminState() {
        return adminState;
    }

    public void setAdminState(Integer adminState) {
        this.adminState = adminState;
    }

    public String getAdminEmail() {
        return adminEmail;
    }

    public void setAdminEmail(String adminEmail) {
        this.adminEmail = adminEmail;
    }

    // 逻辑视图
    public String getAdminStateStr() {
        return this.adminState == 0 ? "禁用" : "启用";
    }


    @Override
    public String toString() {
        return "Admin{" +
                "adminId=" + adminId +
                ", adminName='" + adminName + '\'' +
                ", adminPhone='" + adminPhone + '\'' +
                ", adminPassword='" + adminPassword + '\'' +
                ", adminState=" + adminState +
                ", adminEmail='" + adminEmail + '\'' +
                '}';
    }

    public boolean isEmpty() {
        return "".equals(this.adminName) && "".equals(this.adminPhone) && "".equals(this.adminPassword) && "".equals(adminEmail);
    }
}
